import request from '@/utils/request'
import formurlencoded from 'form-urlencoded'

//会员列表
export function fetchMemberList(query) {
  return request({
    url: '/admin/member/member/list',
    method: 'get',
    params: query
  })
}

//会员升级日志列表
export function fetchMemberUplogList(query) {
  return request({
    url: '/admin/member/member/uploglist',
    method: 'get',
    params: query
  })
}

//会员管理页面经验值日志和积分值日志
export function fetchMemberGrdIntLogList(query) {
  return request({
    url: '/admin/member/member/grdIntloglist',
    method: 'get',
    params: query
  })
}

//会员余额日志
export function fetchMemberBalancelogList(query) {
  return request({
    url: '/admin/member/member/balanceloglist',
    method: 'get',
    params: query
  })
}

//会员收货地址
export function fetchMemberAddressList(query) {
  return request({
    url: '/admin/member/member/addresslist',
    method: 'get',
    params: query
  })
}

//修改经验值和积分
export function valueoptMember(data) {
  return request({
    url: '/admin/member/member/valueopt',
    method: 'post',
    data: formurlencoded(data)
  })
}

//修改会员余额
export function balanceoptMember(data) {
  return request({
    url: '/admin/member/member/balanceopt',
    method: 'post',
    data: formurlencoded(data)
  })
}

//会员经验值规则编辑查询数据
export function gradevalueMember(query) {
  return request({
    url: '/admin/member/config/gradevalue',
    method: 'get',
    params: query
  })
}

//会员经验值规则提交数据
export function gradevalueUpdateMember(data) {
  return request({
    url: '/admin/member/config/gradevalue/update',
    method: 'post',
    data: formurlencoded(data)
  })
}

//会员积分规则编辑查询数据
export function intvalueMember(query) {
  return request({
    url: '/admin/member/config/intvalue',
    method: 'get',
    params: query
  })
}

//会员积分规则提交数据
export function intvalueUpdateMember(data) {
  return request({
    url: '/admin/member/config/intvalue/update',
    method: 'post',
    data: formurlencoded(data)
  })
}

//会员等级配置页面取数据
export function gradeMember(query) {
  return request({
    url: '/admin/member/config/grade',
    method: 'get',
    params: query
  })
}

//会员更新会员等级配置
export function gradeUpdateMember(data) {
  return request({
    url: '/admin/member/config/grade/update',
    method: 'post',
    data: formurlencoded(data)
  })
}

//会员等级减少配置页面取数据
export function gradedownMember(query) {
  return request({
    url: '/admin/member/config/gradedown',
    method: 'get',
    params: query
  })
}

//会员更新会员减少等级配置
export function gradedownUpdateMember(data) {
  return request({
    url: '/admin/member/config/gradedown/update',
    method: 'post',
    data: formurlencoded(data)
  })
}

//积分兑换配置
export function configIntegral(query) {
  return request({
    url: '/admin/config',
    method: 'get',
    params: query
  })
}

//积分兑换配置提交
export function configUpdateIntegral(data) {
  return request({
    url: '/admin/config/update',
    method: 'post',
    data: formurlencoded(data)
  })
}

//会员提款申请列表页
export function memberApplyDrawingList(query) {
  return request({
    url: '/admin/member/drawmoney/list',
    method: 'get',
    params: query
  })
}

//会员提款申请审核通过
export function memberApplyDrawingAuditing(data) {
  return request({
    url: '/admin/member/drawmoney/auditing',
    method: 'post',
    data: formurlencoded(data)
  })
}

//会员提款申请审核拒绝
export function memberApplyDrawingReject(data) {
  return request({
    url: '/admin/member/drawmoney/reject',
    method: 'post',
    data: formurlencoded(data)
  })
}

//会员提款申请已打款
export function memberApplyDrawingPaid(data) {
  return request({
    url: '/admin/member/drawmoney/paid',
    method: 'post',
    data: formurlencoded(data)
  })
}

//会员充值记录
export function memberBalancePayLogList(query) {
  return request({
    url: '/admin/memberBalancePayLog/list',
    method: 'get',
    params: query
  })
}
